import commonService from 'service/common'
import Qs from 'querystring'
export default {
    async getCityList() {
        let paramsJson = {
            method: 'get',
            url: 'http://resource.vipkid.com.cn/static/file/citys.js'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //问题类型
    async getQuestionTypeList() {
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'get',
            url: 'webapi/serviceManagement/questionType/list'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //回复实效
    async getReplyPeriodList() {
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'get',
            url: 'webapi/serviceManagement/replyPeriod/list'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //工单处理组
    async getInitHandlerGroup() {
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'post',
            url: 'webapi/skill/issue'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //处理组
    async getHandlerGroup() {
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'get',
            url: 'webapi/skill/list'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //处理组对应的人员
    async getHanderList(data) {
        let dataObj = Object.assign({ "skillId": "" }, data)
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'get',
            url: 'webapi/skill/users',
            params: dataObj
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //生命周期
    async getLifyCycleList() {
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'get',
            url: 'webapi/serviceManagement/lifeCycleNotice/list'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //组织树
    async getOrganizationList() {
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'post',
            url: 'webapi/organization/list'
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //组织树下的人
    async getUsersByGroupId(data) {
        let dataObj = Object.assign({ 'orgIdList': '' }, data)
        dataObj = Qs.stringify(dataObj)
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'post',
            url: 'webapi/user/listByOrgId',
            headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'X-Requested-With': 'XMLHttpRequest' },
            data: dataObj
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //根据connID更新客户信息接口
    async updateCustomerInfo(data) {
        let dataObj = Object.assign({ 'connID': '', 'customerID': '', 'customerName': '' }, data)
        dataObj = Qs.stringify(dataObj)
        let paramsJson = {
            isUseBaseURL: 'noUse',
            method: 'post',
            url: 'ifly_msgserver/callRecord/updateCustomerInfo.action',
            headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'X-Requested-With': 'XMLHttpRequest' },
            data: dataObj
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)
        return jsondata
    },
    //根据来电号码查询来电归属地信息
    async getLocationOfPhone(data) {
        let dataObj = Object.assign({ 'mobileNumber': '' }, data)
        let paramsJson = {
            baseURL: '/webapiThird/',
            method: 'post',
            url: 'webapi/registrationLocation/phoneNumber',
            data: dataObj
        }
        let jsondata = await commonService.asyncFetchData(paramsJson)

        // jsondata = Qs.parse(jsondata)
        return jsondata
    }



}